package org.spolo.android.adapter;

import org.spolo.android.bean.ActionParameter;
import org.spolo.android.bean.GestureType;
import org.spolo.android.nodetree.Stage;

import android.view.GestureDetector.OnGestureListener;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.View.OnTouchListener;

public class UiListener implements OnGestureListener, OnTouchListener,
		OnClickListener {

	@Override
	public boolean onDown(MotionEvent e) {
		return false;
	}

	@Override
	public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX,
			float velocityY) {

		return false;
	}

	@Override
	public void onLongPress(MotionEvent e) {

	}

	@Override
	public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX,
			float distanceY) {
		ActionParameter ap = new ActionParameter();
		ap.setEvents(e1);
		ap.setEvents(e2);
		Stage.getInstance().injectMessage(GestureType.onMove_left, ap);
		return false;
	}

	@Override
	public void onShowPress(MotionEvent e) {

	}

	@Override
	public boolean onSingleTapUp(MotionEvent e) {
		ActionParameter ap = new ActionParameter();
		ap.setEvents(e);
		Stage.getInstance().injectMessage(GestureType.onClick, ap);
		return false;
	}

	@Override
	public boolean onTouch(View v, MotionEvent event) {

		return false;
	}

	@Override
	public void onClick(View v) {

	}
}
